import axios from '@/utils/request.js'

/**
 * 获取用户列表
 * @returns
 */
export function getDepartmentsApi() {
  return axios({
    url: 'company/department'
  })
}

/**
 * 删除接口
 * @param {*} id
 * @returns
 */
export function delDepartmentsApi(id) {
  return axios({
    url: `/company/department/${id}`,
    method: 'delete'
  })
}

/**
 * 新增部门接口
 **/
export function addDepartmentsApi(data) {
  return axios({
    url: '/company/department',
    method: 'post',
    data
  })
}

/**
 * 获取部门详情
 * @param {*} id
 * @returns
 */
export function getDepartDetailApi(id) {
  return axios({
    url: `/company/department/${id}`
  })
}

/**
 *  编辑部门
 * @param {*} form
 * @returns
 */
export function editDepartMentApi(form) {
  return axios({
    url: `/company/department/${form.id}`,
    method: 'put',
    data: form
  })
}
